﻿<extra:OverlayWindow x:Class="Framework.UI.TestHarness.Views.OverlayWindowExample"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                     xmlns:metro="http://schemas.codeplex.com/elysium"
                     xmlns:params="http://schemas.codeplex.com/elysium/params"
                     xmlns:extra="http://schemas.extra.com/ui"
                     mc:Ignorable="d" 
                     d:DesignHeight="300" d:DesignWidth="300"
                     Title="This title only visible if TitleBarVisibility = Visible (Collapsed by default)">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <extra:AnimatedWrapPanel Grid.Column="1">
            <metro:CommandButton Click="OnClick"
                                 Background="{StaticResource TransparentBrush}"
                                 BorderBrush="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                                 Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                                 Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Right', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                                 Style="{StaticResource OkCommandButtonStyle}"/>
            <metro:CommandButton Click="OnClick"
                                 Background="{StaticResource TransparentBrush}"
                                 BorderBrush="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                                 Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                                 Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Right', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                                 Style="{StaticResource CancelCommandButtonStyle}"/>
        </extra:AnimatedWrapPanel>

        <TextBlock Grid.Column="1"
                   Grid.Row="1"  
                   Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                   Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Top, Right', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                   Style="{StaticResource HeaderTextStyle}" 
                   Text="Title"/>

        <TextBlock Grid.Column="1"
                   Grid.Row="2"  
                   Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                   Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                   Style="{StaticResource NormalTextStyle}" 
                   Text="Content Content Content Content Content Content Content Content Content Content."/>
        
        
        <StackPanel Grid.Column="1" 
                    Grid.Row="3">
            <TextBlock Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Style="{StaticResource HeaderTextStyle}" 
                       Text="Standard Window Properties"/>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <Label Content="HorizontalContentAlignment"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=HorizontalContentAlignmentComboBox}"/>
                <ComboBox x:Name="HorizontalContentAlignmentComboBox" 
                          Grid.Column="1"
                          Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                          SelectedItem="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}">
                    <HorizontalAlignment>Left</HorizontalAlignment>
                    <HorizontalAlignment>Right</HorizontalAlignment>
                    <HorizontalAlignment>Center</HorizontalAlignment>
                    <HorizontalAlignment>Stretch</HorizontalAlignment>
                </ComboBox>

                <Label Grid.Row="1" 
                       Content="VerticalContentAlignment"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=VerticalContentAlignmentComboBox}"/>
                <ComboBox x:Name="VerticalContentAlignmentComboBox" 
                          Grid.Column="1"
                          Grid.Row="1" 
                          Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                          SelectedItem="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}">
                    <VerticalAlignment>Top</VerticalAlignment>
                    <VerticalAlignment>Bottom</VerticalAlignment>
                    <VerticalAlignment>Center</VerticalAlignment>
                    <VerticalAlignment>Stretch</VerticalAlignment>
                </ComboBox>

            </Grid>

            <TextBlock Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Style="{StaticResource HeaderTextStyle}" 
                       Text="Custom Window Properties"/>
            <TextBlock Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Style="{StaticResource NormalTextStyle}" 
                       Text="OverlayWindow has many of the same properties as the Window class (See Window tab). Here are just the most useful ones."/>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <Label Content="IsOverlayVisible"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=IsOverlayVisibleToggleSwitch}"/>
                <metro:ToggleSwitch x:Name="IsOverlayVisibleToggleSwitch" 
                                    Grid.Column="1"
                                    HorizontalAlignment="Left"
                                    IsChecked="{Binding Path=IsOverlayVisible, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}"
                                    Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"/>

                <Label Grid.Row="1" 
                       Content="OverlayBackground"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=OverlayBackgroundTextBox}"/>
                <TextBox x:Name="OverlayBackgroundTextBox" 
                         Grid.Column="1"
                         Grid.Row="1" 
                         Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                         Text="{Binding Path=OverlayBackground, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}"
                         VerticalAlignment="Center"/>

                <Label Grid.Row="2" 
                       Content="OverlayBorderBrush"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=OverlayBorderBrushTextBox}"/>
                <TextBox x:Name="OverlayBorderBrushTextBox" 
                         Grid.Column="1"
                         Grid.Row="2" 
                         Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                         Text="{Binding Path=OverlayBorderBrush, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}"
                         VerticalAlignment="Center"/>

                <Label Grid.Row="3" 
                       Content="OverlayBorderThickness"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=OverlayBorderThicknessTextBox}"/>
                <TextBox x:Name="OverlayBorderThicknessTextBox" 
                         Grid.Column="1"
                         Grid.Row="3" 
                         Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                         Text="{Binding Path=OverlayBorderThickness, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}"
                         VerticalAlignment="Center"/>

                <Label Grid.Row="4" 
                       Content="OverlayMargin"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=OverlayMarginTextBox}"/>
                <TextBox x:Name="OverlayMarginTextBox" 
                         Grid.Column="1"
                         Grid.Row="4" 
                         Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                         Text="{Binding Path=OverlayMargin, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}"
                         VerticalAlignment="Center"/>

                <Label Grid.Row="5" 
                       Content="OverlayOpacity"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=OverlayOpacityTextBox}"/>
                <TextBox x:Name="OverlayOpacityTextBox" 
                         Grid.Column="1"
                         Grid.Row="5" 
                         Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                         Text="{Binding Path=OverlayOpacity, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}"
                         VerticalAlignment="Center"/>

                <Label Grid.Column="2" 
                       Content="IsBusy"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=IsBusyToggleSwitch}"/>
                <metro:ToggleSwitch x:Name="IsBusyToggleSwitch" 
                                    Grid.Column="3"
                                    IsChecked="{Binding Path=IsBusy, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}"
                                    Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"/>

                <Label Grid.Column="2" 
                       Grid.Row="1" 
                       Content="Progress"
                       Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=ProgressDoubleUpDown}"/>
                <extra:DoubleUpDown x:Name="ProgressDoubleUpDown" 
                                    Grid.Column="3"
                                    Grid.Row="1" 
                                    AllowSpin="True"
                                    Increment="10"
                                    Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                                    Maximum="100"
                                    Minimum="0"
                                    ShowButtonSpinner="True"
                                    Value="{Binding Path=Progress, RelativeSource={RelativeSource AncestorType=extra:OverlayWindow}}"/>

                <Label Grid.Column="2" 
                       Grid.Row="2" 
                       Content="TitleBarVisibility"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Target="{Binding ElementName=TitleBarVisibilityComboBox}"/>
                <ComboBox x:Name="TitleBarVisibilityComboBox" 
                          Grid.Column="3"
                          Grid.Row="2" 
                          Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                          SelectedItem="{Binding Path=TitleBarVisibility, RelativeSource={RelativeSource AncestorType={x:Type extra:OverlayWindow}}}">
                    <Visibility>Visible</Visibility>
                    <Visibility>Hidden</Visibility>
                    <Visibility>Collapsed</Visibility>
                </ComboBox>

            </Grid>
        </StackPanel>

    </Grid>
</extra:OverlayWindow>
